package com.ls.uav_backend.controller;

import com.ls.uav_backend.common.BaseResponse;
import com.ls.uav_backend.common.ResultUtils;
import com.ls.uav_backend.model.entity.ChatHistory;
import com.ls.uav_backend.service.ChatHistoryService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 聊天历史记录 控制层。
 *
 * @author <a href="https://gitee.com/Linkating">LinSkating</a>
 */
@RestController
@RequestMapping("/chatHistory")
public class ChatHistoryController {

    @Resource
    private ChatHistoryService chatHistoryService;

    @GetMapping("/get/chat/history/list")
    public BaseResponse<Map<Integer, List<ChatHistory>>> getChatHistoryList() {
        Map<Integer, List<ChatHistory>> chatHistoryList = chatHistoryService.getChatHistoryList();
        return ResultUtils.success(chatHistoryList);
    }

}
